import request from './service'

export const get_user_info = (data) => request({url: '/share_glasses_api/user/get_user_info', method: 'post', data})

export const get_session_key = (queryParams) => {
    let query = new URLSearchParams()
    for (let item in queryParams) {
        query.append(item, queryParams[item])
    }
    return request({url: '/share_glasses_api/user/get_session_key?' + query.toString(), method: 'get'})
}
export const login = (data) => request({url: '/share_glasses_api/user/login', method: 'post', data})

export const trigger_refund = () => request({url: '/share_glasses_api/order_pay/trigger_refund', method: 'get'})

export const glassList = () => request({url: '/share_glasses_api/order_pay/query_glasses_list', method: 'get'})


export const doOrder = (data) => request({url: '/share_glasses_api/order_pay/do_order', method: 'post', data})

export const getUnifiedorder = (data) => request({url: '/share_glasses_api/order_pay/get_unifiedorder', method: 'post', data})

export const queryOrderList = (data) => request({url: '/share_glasses_api/order_pay/query_order_list', method: 'post', data})

export const queryOrderInfo = (data) => request({url: '/share_glasses_api/order_pay/query_order_info', method: 'post', data})


export const cancel_order = (data) => request({url: '/share_glasses_api/order_pay/cancel_order', method: 'post', data})


export const query_balance = () => request({url: '/share_glasses_api/order_pay/query_balance', method: 'get'})

export const do_refund = () => request({url: '/share_glasses_api/order_pay/do_refund', method: 'get'})


export const return_order_glasses_list = (data) => request({url: '/share_glasses_api/order_pay/return_order_glasses_list', method: 'post', data})


export const return_order_glasses_info = (data) => request({url: '/share_glasses_api/order_pay/return_order_glasses_info', method: 'post', data})



export const query_refund_record = (queryParams) => {
    let query = new URLSearchParams()
    for (let item in queryParams) {
        query.append(item, queryParams[item])
    }
    return request({url: '/share_glasses_api/order_pay/query_refund_record?' + query.toString(), method: 'get'})
}

export const add_complaint = (data) => request({url: '/share_glasses_api/user/add_complaint', method: 'post', data})


export const query_complaint_list = (data) => request({url: '/share_glasses_api/user/query_complaint_list', method: 'post', data})


export const query_guide_list = () => request({url: '/share_glasses_api/user/query_guide_list', method: 'get'})


export const create_wx_config = (data) => request({url: '/share_glasses_api/user/create_wx_config', method: 'post', data})
